package com.luoyi.util.ehr;

import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;

import java.util.Map;
import java.util.stream.Collectors;

/**
 * 人力共享平台导入数据工具
 *
 * @author xt
 */
public class ExcelImportUtil {



    public static void main(String[] args) {
        JSONArray data = JSONArray.parseArray("[\n" +
                "    {\n" +
                "        \"GUID\": \"200000000000000000099642\",\n" +
                "        \"0002--F1000\": \"测试111\",\n" +
                "        \"0002--F1005\": \"1-男\",\n" +
                "        \"0002--F1130\": \"01-身份证\",\n" +
                "        \"0002--F1135\": \"430923199111110101\",\n" +
                "        \"0002--F1025\": \"0-未婚\",\n" +
                "        \"0002--F1035\": \"云南·丘北\",\n" +
                "        \"0002--F1015\": \"19911111\",\n" +
                "        \"0002--F1020\": \"33\",\n" +
                "        \"0002--F1045\": \"01-汉族\",\n" +
                "        \"0002--F1065\": \"165\",\n" +
                "        \"0002--F1060\": \"56\",\n" +
                "        \"0006--F1100\": \"15616786543\",\n" +
                "        \"0022--F1260r\": \"20110901\",\n" +
                "        \"0022--F1265\": \"20150630\",\n" +
                "        \"0022--F1275\": \"30-本科\",\n" +
                "        \"0022--F1270\": \"湖南大学\",\n" +
                "        \"0022--F1276\": \"X-是\",\n" +
                "        \"0022--F1277\": \"X-是\",\n" +
                "        \"0022--F1278\": \"X-是\",\n" +
                "        \"0022--F1280\": \"2-材料类\",\n" +
                "        \"0022--F1285\": \"材料\",\n" +
                "        \"0022--F1290\": \"1-统招\",\n" +
                "        \"0022--F1295\": \"01-全日制\",\n" +
                "        \"0022--F1296\": \"3-学士学位\",\n" +
                "        \"0022--F1300\": \"31-大学本科毕业\",\n" +
                "        \"0022--F1305\": \"111\",\n" +
                "        \"0023--F1450\": \"20170101\",\n" +
                "        \"0023--F1455\": \"20180101\",\n" +
                "        \"0023--F1410\": \"兴盛优选\",\n" +
                "        \"0023--F1425\": \"技术\",\n" +
                "        \"9028--F1585\": \" -无\",\n" +
                "        \"9028--F1595\": \"X-有\",\n" +
                "        \"0000--F1211\": \"13-工人\",\n" +
                "        \"0000--F1250\": \"1000-中联重科总部\",\n" +
                "        \"0000--F1220\": \"00000225-人力资源管理\",\n" +
                "        \"0000--F1225\": \"人事\",\n" +
                "        \"0000--F1235\": \"001-管理\",\n" +
                "        \"0000--F1240\": \"B-B 试用期合同工\",\n" +
                "        \"0000--F1620\": \" -否\",\n" +
                "        \"0000--F1692\": \" -否\",\n" +
                "        \"9039--F1649\": \"10-月薪\",\n" +
                "        \"9039--F1640\": \"10-11\",\n" +
                "        \"9039--F1650\": \"5000\",\n" +
                "        \"9032--F2025\": \"CS-长沙\",\n" +
                "        \"9032--F2030\": \"10006325-中联重科股份有限公司-1000-CS\",\n" +
                "        \"9032--F2031\": \"014550-中联重科股份有限公司-1000-CS\"\n" +
                "    },\n" +
                "    {\n" +
                "        \"GUID\": \"200000000000000000099642\",\n" +
                "        \"0002--F1000\": \"\",\n" +
                "        \"0002--F1005\": \"\",\n" +
                "        \"0002--F1130\": \"\",\n" +
                "        \"0002--F1135\": \"\",\n" +
                "        \"0002--F1025\": \"\",\n" +
                "        \"0002--F1035\": \"\",\n" +
                "        \"0002--F1015\": \"\",\n" +
                "        \"0002--F1020\": \"\",\n" +
                "        \"0002--F1045\": \"\",\n" +
                "        \"0002--F1065\": \"\",\n" +
                "        \"0002--F1060\": \"\",\n" +
                "        \"0006--F1100\": \"\",\n" +
                "        \"0022--F1260r\": \"\",\n" +
                "        \"0022--F1265\": \"\",\n" +
                "        \"0022--F1275\": \"\",\n" +
                "        \"0022--F1270\": \"\",\n" +
                "        \"0022--F1276\": \"\",\n" +
                "        \"0022--F1277\": \"\",\n" +
                "        \"0022--F1278\": \"\",\n" +
                "        \"0022--F1280\": \"\",\n" +
                "        \"0022--F1285\": \"\",\n" +
                "        \"0022--F1290\": \"\",\n" +
                "        \"0022--F1295\": \"\",\n" +
                "        \"0022--F1296\": \"\",\n" +
                "        \"0022--F1300\": \"\",\n" +
                "        \"0022--F1305\": \"\",\n" +
                "        \"0023--F1450\": \"20180102\",\n" +
                "        \"0023--F1455\": \"20190101\",\n" +
                "        \"0023--F1410\": \"益丰\",\n" +
                "        \"0023--F1425\": \"技术\",\n" +
                "        \"9028--F1585\": \"\",\n" +
                "        \"9028--F1595\": \"\",\n" +
                "        \"0000--F1211\": \"\",\n" +
                "        \"0000--F1250\": \"\",\n" +
                "        \"0000--F1220\": \"\",\n" +
                "        \"0000--F1225\": \"\",\n" +
                "        \"0000--F1235\": \"\",\n" +
                "        \"0000--F1240\": \"\",\n" +
                "        \"0000--F1620\": \"\",\n" +
                "        \"0000--F1692\": \"\",\n" +
                "        \"9039--F1649\": \"\",\n" +
                "        \"9039--F1640\": \"\",\n" +
                "        \"9039--F1650\": \"\",\n" +
                "        \"9032--F2025\": \"\",\n" +
                "        \"9032--F2030\": \"\",\n" +
                "        \"9032--F2031\": \"\"\n" +
                "    },\n" +
                "    {\n" +
                "        \"GUID\": \"200000000000000000099643\",\n" +
                "        \"0002--F1000\": \"测试222\",\n" +
                "        \"0002--F1005\": \"2-女\",\n" +
                "        \"0002--F1130\": \"01-身份证\",\n" +
                "        \"0002--F1135\": \"430923199111110102\",\n" +
                "        \"0002--F1025\": \"0-未婚\",\n" +
                "        \"0002--F1035\": \"云南·云县\",\n" +
                "        \"0002--F1015\": \"19911111\",\n" +
                "        \"0002--F1020\": \"33\",\n" +
                "        \"0002--F1045\": \"01-汉族\",\n" +
                "        \"0002--F1065\": \"175\",\n" +
                "        \"0002--F1060\": \"59\",\n" +
                "        \"0006--F1100\": \"15616192345\",\n" +
                "        \"0022--F1260r\": \"20110901\",\n" +
                "        \"0022--F1265\": \"20150630\",\n" +
                "        \"0022--F1275\": \"30-本科\",\n" +
                "        \"0022--F1270\": \"湖南大学\",\n" +
                "        \"0022--F1276\": \"X-是\",\n" +
                "        \"0022--F1277\": \"X-是\",\n" +
                "        \"0022--F1278\": \"X-是\",\n" +
                "        \"0022--F1280\": \"2-材料类\",\n" +
                "        \"0022--F1285\": \"材料\",\n" +
                "        \"0022--F1290\": \"1-统招\",\n" +
                "        \"0022--F1295\": \"01-全日制\",\n" +
                "        \"0022--F1296\": \"3-学士学位\",\n" +
                "        \"0022--F1300\": \"31-大学本科毕业\",\n" +
                "        \"0022--F1305\": \"111\",\n" +
                "        \"0023--F1450\": \"20180102\",\n" +
                "        \"0023--F1455\": \"20190101\",\n" +
                "        \"0023--F1410\": \"益丰\",\n" +
                "        \"0023--F1425\": \"技术\",\n" +
                "        \"9028--F1585\": \" -无\",\n" +
                "        \"9028--F1595\": \"X-有\",\n" +
                "        \"0000--F1211\": \"13-工人\",\n" +
                "        \"0000--F1250\": \"1000-中联重科总部\",\n" +
                "        \"0000--F1220\": \"00000225-人力资源管理\",\n" +
                "        \"0000--F1225\": \"人事\",\n" +
                "        \"0000--F1235\": \"001-管理\",\n" +
                "        \"0000--F1240\": \"B-B 试用期合同工\",\n" +
                "        \"0000--F1620\": \" -否\",\n" +
                "        \"0000--F1692\": \" -否\",\n" +
                "        \"9039--F1649\": \"10-月薪\",\n" +
                "        \"9039--F1640\": \"10-12\",\n" +
                "        \"9039--F1650\": \"6000\",\n" +
                "        \"9032--F2025\": \"CS-长沙\",\n" +
                "        \"9032--F2030\": \"10006325-中联重科股份有限公司-1000-CS\",\n" +
                "        \"9032--F2031\": \"014550-中联重科股份有限公司-1000-CS\"\n" +
                "    }\n" +
                "]");
        JSONArray tableFieldArray = JSONArray.parseArray("[{\"FUNC\":\"\",\"ZHR_LW\":\"1\",\"FIELD\":\"GUID\",\"FIELN\":\"GUID\",\"id\":0,\"ZTYPE\":\"\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1000\",\"ZHR_LW\":\"2\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"姓名\",\"id\":436,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1005\",\"ZHR_LW\":\"3\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"性别\",\"id\":437,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1130\",\"ZHR_LW\":\"4\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证件类型\",\"id\":438,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1135\",\"ZHR_LW\":\"5\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证件号码\",\"id\":439,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1025\",\"ZHR_LW\":\"6\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"婚姻状况\",\"id\":440,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1035\",\"ZHR_LW\":\"7\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"员工籍贯\",\"id\":441,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0002--F1015\",\"ZHR_LW\":\"8\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"出生日期\",\"id\":442,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1020\",\"ZHR_LW\":\"9\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"年龄\",\"id\":443,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1045\",\"ZHR_LW\":\"10\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"民族\",\"id\":444,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1065\",\"ZHR_LW\":\"11\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"身高(cm)\",\"id\":445,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1060\",\"ZHR_LW\":\"12\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"体重(kg)\",\"id\":446,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0006--F1100\",\"ZHR_LW\":\"13\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"联系方式\",\"id\":447,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0022--F1260\",\"ZHR_LW\":\"14\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"开始时间\",\"id\":448,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0022--F1265\",\"ZHR_LW\":\"15\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"结束时间\",\"id\":449,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1275\",\"ZHR_LW\":\"16\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学历\",\"id\":450,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1270\",\"ZHR_LW\":\"17\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学校\",\"id\":451,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1276\",\"ZHR_LW\":\"18\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否最高学历\",\"id\":452,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1277\",\"ZHR_LW\":\"19\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否最高学位\",\"id\":453,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1278\",\"ZHR_LW\":\"20\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否初始学历\",\"id\":454,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1280\",\"ZHR_LW\":\"21\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"专业类别\",\"id\":455,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1285\",\"ZHR_LW\":\"22\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"专业名称\",\"id\":456,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1290\",\"ZHR_LW\":\"23\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"教育类型\",\"id\":457,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1295\",\"ZHR_LW\":\"24\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学习形式\",\"id\":458,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1296\",\"ZHR_LW\":\"25\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学位名称\",\"id\":459,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1300\",\"ZHR_LW\":\"26\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证书\",\"id\":460,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1305\",\"ZHR_LW\":\"27\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学历证书编号(高中及以下可填0000)\",\"id\":461,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0023--F1450\",\"ZHR_LW\":\"28\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"开始时间\",\"id\":462,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0023--F1455\",\"ZHR_LW\":\"29\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"结束时间\",\"id\":463,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0023--F1410\",\"ZHR_LW\":\"30\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"企业名称\",\"id\":464,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0023--F1425\",\"ZHR_LW\":\"31\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位名称\",\"id\":465,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9028--F1585\",\"ZHR_LW\":\"32\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"有无劳动争议记录\",\"id\":466,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9028--F1595\",\"ZHR_LW\":\"33\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"有无犯罪记录\",\"id\":467,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1211\",\"ZHR_LW\":\"34\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"招聘类别\",\"id\":468,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1250\",\"ZHR_LW\":\"35\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"人事范围\",\"id\":469,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0000--F1220\",\"ZHR_LW\":\"36\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"末级组织\",\"id\":470,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0000--F1225\",\"ZHR_LW\":\"37\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位名称\",\"id\":471,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1235\",\"ZHR_LW\":\"38\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位类别\",\"id\":472,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1240\",\"ZHR_LW\":\"39\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"员工组\",\"id\":473,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1620\",\"ZHR_LW\":\"40\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否二次入职\",\"id\":474,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1692\",\"ZHR_LW\":\"41\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否录用担保岗位\",\"id\":475,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9039--F1649\",\"ZHR_LW\":\"42\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"薪酬结构\",\"id\":476,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"K\",\"FIELD\":\"9039--F1640\",\"ZHR_LW\":\"43\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"薪级\",\"id\":477,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"9039--F1650\",\"ZHR_LW\":\"44\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"工资标准（元）\",\"id\":478,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2025\",\"ZHR_LW\":\"45\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"社保公积金缴纳地\",\"id\":479,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2030\",\"ZHR_LW\":\"46\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"默认社保缴纳主体\",\"id\":480,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2031\",\"ZHR_LW\":\"47\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"默认公积金缴纳主体\",\"id\":481,\"ZTYPE\":\"ZZPGL1\"}]");
        formatSaveData(data, tableFieldArray);
    }


    /**
     * 模拟前端将数据转成key value
     * @param data 第三步解析的数据，第四步提交的数据准备
     * @param tableFieldArray 表头信息
     */
    public static void formatSaveData(JSONArray data , JSONArray tableFieldArray) {
        Map<String, JSONObject> headFieldMap = tableFieldArray.stream().collect(Collectors.toMap(x -> ((JSONObject) x)
                .getString("FIELD"), x -> (JSONObject)x));
        for (int i = 0; i < data.size(); i++) {
            JSONObject jsonObject = data.getJSONObject(i);
            jsonObject.forEach((k, v) -> {
                String fType = headFieldMap.get(k).getString("FTYPE");
                if ("D".equals(fType)) {
                    if (!v.toString().contains("-")) {
                        return;
                    }
                    String[] split = v.toString().split("-");
                    String key = split[0].trim();
                    String value = split[1].trim();
                    String format = StrUtil.format("{\"KEY\":\"{}\", \"VALUE\":\"{}\"}", key, value);
                    jsonObject.put(k, format);
                } else if ("K".equals(fType)) {
                    String format = StrUtil.format("{\"KEY\":\"{}\", \"VALUE\":\"{}\"}", v, v);
                    jsonObject.put(k, format);
                }
            });
        }
        System.out.println(data.toJSONString());
    }


    /**
     * 第三步：解析时的字段，字段格式化
     */
    private static void saveBeforeFieldArray() {
        String aa = "[\n" +
                "        {\n" +
                "            \"FUNC\": \"\",\n" +
                "            \"ZHR_LW\": \"1\",\n" +
                "            \"FIELD\": \"GUID\",\n" +
                "            \"FIELN\": \"GUID\",\n" +
                "            \"id\": 0,\n" +
                "            \"ZTYPE\": \"\"\n" +
                "        },\n" +
                "        {\"FTYPE\":\"\",\"FIELD\":\"0002--F1000\",\"ZHR_LW\":\"2\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"姓名\",\"id\":436,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1005\",\"ZHR_LW\":\"3\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"性别\",\"id\":437,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1130\",\"ZHR_LW\":\"4\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证件类型\",\"id\":438,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1135\",\"ZHR_LW\":\"5\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证件号码\",\"id\":439,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1025\",\"ZHR_LW\":\"6\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"婚姻状况\",\"id\":440,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1035\",\"ZHR_LW\":\"7\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"员工籍贯\",\"id\":441,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0002--F1015\",\"ZHR_LW\":\"8\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"出生日期\",\"id\":442,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1020\",\"ZHR_LW\":\"9\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"年龄\",\"id\":443,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0002--F1045\",\"ZHR_LW\":\"10\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"民族\",\"id\":444,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1065\",\"ZHR_LW\":\"11\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"身高(cm)\",\"id\":445,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0002--F1060\",\"ZHR_LW\":\"12\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"体重(kg)\",\"id\":446,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0006--F1100\",\"ZHR_LW\":\"13\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"联系方式\",\"id\":447,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0022--F1260r\",\"ZHR_LW\":\"14\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"开始时间\",\"id\":448,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0022--F1265\",\"ZHR_LW\":\"15\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"结束时间\",\"id\":449,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1275\",\"ZHR_LW\":\"16\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学历\",\"id\":450,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1270\",\"ZHR_LW\":\"17\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学校\",\"id\":451,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1276\",\"ZHR_LW\":\"18\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否最高学历\",\"id\":452,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1277\",\"ZHR_LW\":\"19\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否最高学位\",\"id\":453,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1278\",\"ZHR_LW\":\"20\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否初始学历\",\"id\":454,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1280\",\"ZHR_LW\":\"21\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"专业类别\",\"id\":455,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1285\",\"ZHR_LW\":\"22\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"专业名称\",\"id\":456,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1290\",\"ZHR_LW\":\"23\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"教育类型\",\"id\":457,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1295\",\"ZHR_LW\":\"24\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学习形式\",\"id\":458,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1296\",\"ZHR_LW\":\"25\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学位名称\",\"id\":459,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0022--F1300\",\"ZHR_LW\":\"26\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"证书\",\"id\":460,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0022--F1305\",\"ZHR_LW\":\"27\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"学历证书编号(高中及以下可填0000)\",\"id\":461,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0023--F1450\",\"ZHR_LW\":\"28\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"开始时间\",\"id\":462,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"T\",\"FIELD\":\"0023--F1455\",\"ZHR_LW\":\"29\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"结束时间\",\"id\":463,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0023--F1410\",\"ZHR_LW\":\"30\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"企业名称\",\"id\":464,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0023--F1425\",\"ZHR_LW\":\"31\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位名称\",\"id\":465,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9028--F1585\",\"ZHR_LW\":\"32\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"有无劳动争议记录\",\"id\":466,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9028--F1595\",\"ZHR_LW\":\"33\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"有无犯罪记录\",\"id\":467,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1211\",\"ZHR_LW\":\"34\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"招聘类别\",\"id\":468,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1250\",\"ZHR_LW\":\"35\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"人事范围\",\"id\":469,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0000--F1220\",\"ZHR_LW\":\"36\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"末级组织\",\"id\":470,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"0000--F1225\",\"ZHR_LW\":\"37\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位名称\",\"id\":471,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1235\",\"ZHR_LW\":\"38\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"职位类别\",\"id\":472,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1240\",\"ZHR_LW\":\"39\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"员工组\",\"id\":473,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1620\",\"ZHR_LW\":\"40\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否二次入职\",\"id\":474,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"0000--F1692\",\"ZHR_LW\":\"41\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"是否录用担保岗位\",\"id\":475,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9039--F1649\",\"ZHR_LW\":\"42\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"薪酬结构\",\"id\":476,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9039--F1640\",\"ZHR_LW\":\"43\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"薪级\",\"id\":477,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"\",\"FIELD\":\"9039--F1650\",\"ZHR_LW\":\"44\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"工资标准（元）\",\"id\":478,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2025\",\"ZHR_LW\":\"45\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"社保公积金缴纳地\",\"id\":479,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2030\",\"ZHR_LW\":\"46\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"默认社保缴纳主体\",\"id\":480,\"ZTYPE\":\"ZZPGL1\"},{\"FTYPE\":\"D\",\"FIELD\":\"9032--F2031\",\"ZHR_LW\":\"47\",\"ZHR_DRMBLX\":\"RZ02\",\"FIELN\":\"默认公积金缴纳主体\",\"id\":481,\"ZTYPE\":\"ZZPGL1\"}\n" +
                "    ]";
        JSONArray objects = JSONArray.parseArray(aa);
        JSONArray objects1 = new JSONArray();
        for (Object object : objects) {
            JSONObject jsonObject = (JSONObject) object;
            JSONObject jsonObject1 = new JSONObject();
            jsonObject1.put("field", jsonObject.get("FIELD"));
            objects1.add(jsonObject1);
        }
        System.out.println(objects1.toJSONString());
    }
}
